<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户管理</title>
<link rel="stylesheet" type="text/css" href="ui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="ui/themes/icon.css">
<script type="text/javascript" src="ui/jquery.min.js"></script>
<script type="text/javascript" src="ui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="ui/jquery.serializejson.min.js"></script>
<script type="text/javascript" src="js/crud.js"></script>
<script type="text/javascript" src="ui/date.js"></script>
<script type="text/javascript">
	var name="emp";
	var height=400;
	var width = 450;
	var columns=[[
	  		    {field:'id',title:'编号',width:100},
	  		    {field:'username',title:'登录名称',width:100},
	  		    {field:'name',title:'真实姓名',width:100},
	  		    
	  		    {field:'gender',title:'性别',width:100,formatter:function(value,row,index){
	  		    	 value=row.gender; //表里的值
	  		    	 if(1==value){
	  		    		 return '男';
	  		    	 }
	  		    	 if(0==value){
	  		    		 return '女';
	  		    	 }
	  		    }},
	  		    {field:'email',title:'邮箱',width:100},
	  		    {field:'tele',title:'电话',width:100},
	  		    
	  		    {field:'address',title:'地址',width:100},
	  		    {field:'birthday',title:'出生年月',width:100,formatter:function(value,row,index){
	  		    	return new Date(value).Format("yyyy-MM-dd");
	  		    	
	  		    }},
	  		    {field:'dept',title:'部门',width:100,formatter:function(value,row,index){
	  		    	return value.name;
	  		    }},

				{field:'-',title:'操作',width:200,formatter: function(value,row,index){
					var oper = "<a href=\"javascript:void(0)\" onclick=\"edit(" + row.id + ')">修改</a>';
					oper += ' <a href="javascript:void(0)" onclick="del(' + row.id + ')">删除</a>';
					return oper;
				}}
				]];

</script>
</head>
<body>
<div class="easyui-panel" style="padding-left:4px;border-bottom:0px;">
	<div style="height:2px;"></div>
	<form id="searchForm">
			用户名称：<input name="t1.name" >
	联系电话：<input name="t1.tele" >

		<button type="button" id="btnSearch">查询</button>
	</form>
	<div style="height:2px;"></div>
</div>
<table id="grid"></table>

<div id="editDlg">
	<form id="editForm">
			<input name="t.id" type="hidden"> 

		   <table >
			<tr align="center">
				<td>登 录名:</td><td><input name="t.username"> </td>
			</tr>
			<tr align="center">
				<td>真实姓名:</td><td><input name="t.name"> </td>
			</tr>
			<tr align="center">
				<td>密码:</td><td><input name="t.pwd" type="password"> </td>
			</tr>
			<tr align="center">
				<td>性别:</td>
				<td><input type="radio" name="t.gender" value="0">女<input type="radio" name="t.gender" checked="checked" value="1">男 </td>
			</tr>
			
			<tr align="center">
				<td>邮箱：</td><td><input name="t.email" class="easyui-validatebox" data-options="required:true,validType:'email',invalidMessage:'Email格式不正确'"> </td>
			</tr>
			
			<tr align="center">
				<td>联系电话：</td><td><input name="t.tele"> </td>
			</tr>
			
			<tr align="center">
				<td>联系地址：</td><td><input name="t.address"> </td>
			</tr>
			<tr align="center">
				<td>出生年月：</td><td><input name="t.birthday" class="easyui-datebox" required="required" editable="false"> </td>
			</tr>
			
			<tr align="center">
				<td>部门：</td><td><input name="t.dept.id"  class="easyui-combobox"   
    data-options="valueField:'id',textField:'name',url:'dept_list'"> </td>
			</tr>

		</table>
		<button id="btnSave" type="button">保存</button>
	</form>
</div>

</body>
</html>
